/*
 * @Description: 
 * @Author: mmzhang
 * @Date: 2021-12-10 16:52:09
 * @LastEditTime: 2022-02-22 09:54:27
 */
import Opt from '@/components/dt/info/Opt.js'
import businessCommonMgr from '@/biz/businessReport/businessCommon'

let _this = null
let companys = []
class SearchOpt extends Opt {
  constructor(vm) {
    _this = vm
    super()
    this.build()
  }
  getCompany() {
    let opt = {
      title: '组织筛选',
      key: 'officeIds',
      placeholder: '全部',
      tree: {
        options: companys,
      }
    }
    let params = {
      isTwoLevel: true,
    }
    businessCommonMgr
      .getOrgThreeTree(params)
      .then((res) => {
        companys = res
        opt.tree.options = companys
      })
    return opt
  }
  build() {
    this.createAll()
    this.opts.push(...this.all)
  }
  createAll() {
    this.all = [
      // this.getCompany(),
      {
        title: '展示名称',
        key: 'companyName',
        input: {},
      }
    ]
  }
}

export default SearchOpt